package lpg;

class FilterMacroElement
{
    FilterMacroElement(String name, String value)
    {
        macroName = getValue(name);
        macroValue = getValue(value);
    }

    //TODO: this method should be simplified with the java.io.File
    private static String getValue(String str)
    {
        int separator = Math.max(Math.max(str.lastIndexOf('/'), str.lastIndexOf('\\')), str.lastIndexOf(':')); 
        int start = (separator >= 0) ? separator + 1 : 0;
        int dot = str.lastIndexOf('.');
        return (dot >= start) ? str.substring(start, dot) : str.substring(start);
    }

    final String macroName;
    final String macroValue;

}
